package com.java2nb.novel.pay.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 查询支付订单响应VO
 */
@Data
@ApiModel(value = "QueryPayOrderResponseVO", description = "查询支付订单响应实体")
public class QueryPayOrderResponseVO {
    @ApiModelProperty(value = "返回码", required = true, example = "0", notes = "0=成功，9999=异常", allowableValues = "0, 9999")
    private String code = "0"; // 0=成功，9999=异常

    @ApiModelProperty(value = "返回描述", required = true, example = "success", notes = "成功或失败的描述信息")
    private String msg = "success";

    @ApiModelProperty(value = "业务数据", notes = "查询到的支付订单详情，成功时返回，失败时为null")
    private QueryPayOrderData data;

    @ApiModelProperty(value = "签名", example = "a1b2c3d4e5f6g7h8i9j0", notes = "响应数据的签名，用于验证数据完整性")
    private String sign;

    @ApiModelProperty(value = "签名类型", required = true, example = "MD5", notes = "签名算法类型，默认MD5")
    private String signType = "MD5";

    @Data
    @ApiModel(value = "QueryPayOrderData", description = "查询支付订单响应中的业务数据")
    public static class QueryPayOrderData {
        @ApiModelProperty(value = "支付中心订单号", example = "PAY20230908123456789", notes = "支付系统生成的唯一订单标识")
        private String payOrderId;    // 支付中心订单号

        @ApiModelProperty(value = "商户订单号", example = "MCH20230908123456789", notes = "商户系统传入的原始订单号")
        private String mchOrderNo;    // 商户订单号

        @ApiModelProperty(value = "商户号", example = "MCH0000001", notes = "商户唯一标识")
        private String mchNo;         // 商户号

        @ApiModelProperty(value = "应用ID", example = "APP0000001", notes = "商户下的应用唯一标识")
        private String appId;         // 应用ID

        @ApiModelProperty(value = "支付方式", example = "WX_H5", notes = "支付渠道编码（如微信H5、支付宝等）")
        private String wayCode;       // 支付方式

        @ApiModelProperty(value = "支付金额", example = "100", notes = "支付金额，单位为分")
        private Integer amount;       // 支付金额（分）

        @ApiModelProperty(value = "货币代码", example = "CNY", notes = "货币类型，默认CNY（人民币）")
        private String currency;      // 货币代码

        @ApiModelProperty(value = "支付状态", example = "1", notes = "0=待支付，1=成功，2=失败，3=关闭", allowableValues = "0,1,2,3")
        private Integer payStatus;    // 支付状态（0=待支付，1=成功，2=失败，3=关闭）

        @ApiModelProperty(value = "支付状态描述", example = "支付成功", notes = "支付状态的文字说明")
        private String payStatusDesc; // 支付状态描述

        @ApiModelProperty(value = "商品标题", example = "会员充值", notes = "订单对应的商品标题")
        private String subject;       // 商品标题

        @ApiModelProperty(value = "商品描述", example = "月度会员充值，有效期30天", notes = "订单对应的商品详细描述")
        private String body;          // 商品描述

        @ApiModelProperty(value = "客户端IP", example = "192.168.1.1", notes = "用户支付时的客户端IP地址")
        private String clientIp;      // 客户端IP

        @ApiModelProperty(value = "异步通知地址", example = "https://api.example.com/notify", notes = "支付结果回调的商户接口地址")
        private String notifyUrl;     // 异步通知地址

        @ApiModelProperty(value = "同步跳转地址", example = "https://www.example.com/pay/success", notes = "支付完成后跳转的商户页面地址")
        private String returnUrl;     // 同步跳转地址

        @ApiModelProperty(value = "订单失效时间", example = "1694188800000", notes = "订单失效的时间戳（13位毫秒数）")
        private Long expiredTime;     // 订单失效时间（13位时间戳）

        @ApiModelProperty(value = "订单创建时间", example = "1694181600000", notes = "订单创建的时间戳（13位毫秒数）")
        private Long createTime;      // 订单创建时间（13位时间戳）

        @ApiModelProperty(value = "支付成功时间", example = "1694182000000", notes = "支付成功的时间戳（13位毫秒数，未支付则为null）")
        private Long payTime;         // 支付成功时间（13位时间戳，未支付则为null）

        @ApiModelProperty(value = "渠道流水号", example = "4200001890202309081234567890", notes = "支付渠道返回的流水号，未支付则为null")
        private String channelTrxId;  // 渠道流水号（未支付则为null）
    }
}
